package com.lq.demo.demo.netty.protocol;

import io.netty.channel.Channel;
import io.netty.util.Attribute;

/**
 * @Auther: LQ
 * @Date: 2018/11/24 23:21
 * @Description:
 */
public class LoginUtil {

    public static void markAsLogin(Channel channel) {
        channel.attr(Attributes.LOGIN).set(true);
    }

    public static boolean hasLogin(Channel channel) {
        Attribute<Boolean> attr = channel.attr(Attributes.LOGIN);
        return attr.get() != null ;
    }
}
